package com.zijie.hosptal;

import com.zijie.hosptal.pojo.po.Doctor;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.HashMap;

@SpringBootTest
public class DoctorMapper {
    @Autowired
    private com.zijie.hosptal.mapper.DoctorMapper doctorMapper;
   @Autowired
   private com.zijie.hosptal.service.DoctorService doctorService;
    @Test
    public void testFindList() {
        Doctor doctor = new Doctor();
        doctor.setName("张三");
        doctor.setSpecialization("皮肤科");
        System.out.println(doctorService.save(doctor));

    }
    @Test
    public void testFindById() {
        Doctor doctor = new Doctor();
        doctor.setId(1);
        doctor.setName("张2三");
        doctor.setSpecialization("皮肤科");
        System.out.println(doctorService.updateById(doctor));
    }
    @Test
    public void testFindAll() {
        HashMap<String, String> map = new HashMap<>();
        map.put("name", "张三");
        map.put("specialization", "皮肤科");
        map.forEach((k, v) -> System.out.println(k + ":" + v));
        for (String s : map.keySet()) {
            System.out.println(s);
        }
//        Thread.sleep(1);
    }

}
